<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="__ADMIN__/css/font.css">
<link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
<script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
<script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
<link rel="stylesheet" href="/static/admin/css/font.css">
<link rel="stylesheet" href="/static/admin/css/font-awesome.min.css">
<style>
.layui-form-item .layui-form-label{
    width: 120px;
}
.layui-form-item .layui-textarea{
    width: 190px;
}
#phone-one-div {display: none}
.layui-form-select {z-index: 99999 !important}
.layui-upload-file{display:block !important}

</style>
</head>

<body>
<div class="x-body">
<form class="layui-form" action="">

 
<table class="layui-table" lay-size="sm">
  <colgroup>
    <col>
  </colgroup>
  <tbody>

    <tr>
        <td>
            <a href="/admin.php/ds/avatar/?id={:session('uid','','admin')}" target="_blank"><img id="img" src="/admin.php/ds/avatar/?id={:session('uid','','admin')}" width="250px" style="margin-top: 5px;display: block;"></a>
            <button type="button" style="width: 140px;" class="layui-btn layui-btn-sm layui-btn-normal" id="uploads">上传图片</button>
        </td>
    </tr>
    <!--<tr>-->
    <!--  <td colspan="2" align="center">    -->
    <!--    <button type="button" class="layui-btn" lay-filter="add" lay-submit="">确定</button>-->
    <!--  </td>-->
    <!--</tr>-->
  </tbody>
</table>
<input type="hidden" name="id" value="{$data.id}">



</form>
</div>
<script>

    
    
layui.use(['form','layer','laydate','upload','layarea','rate'], function(){
    var $ = layui.jquery;
    var form = layui.form
    ,layer = layui.layer
    ,laydate = layui.laydate
    ,upload = layui.upload
    ,layarea = layui.layarea
    ,rate = layui.rate;

    var uploadInst = upload.render({
          elem: '#uploads'
          , url: '{:url("index/uploadAvatar")}'
          , before: function (obj) {
            //预读本地文件示例，不支持ie8
            obj.preview(function (index, file, result){
                //如果有图片再点击上传就撤销原来的图片
                var img=$("#img").attr("src");
                var imgurl=$("#settle_image").val();
                $('#img').attr('src', result); //图片链接(base64)
            });
          }
          , done: function (res) {
              //如果上传失败
              if (res.code == 0) {
                  return layer.msg(res.err);
              }
              //上传成功
              if(res.code == 1) {
                  layer.alert('上传成功');
              }
          }
    });
      
      
});
    </script>
  </body>

</html>